<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Berry - News</title>
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/navbar.css' %}">
    <link rel="stylesheet" href="{% static 'css/news.css' %}">
</head>
<body class="news-body">
{% include 'navbar.html' %}
    <h1></h1>
    <ul>
        {% for news in latest_news %}
            <li>
                <h2>{{ news.title }}</h2>
                <p>{{ news.create_time }}</p>
                <p>{{ news.content }}</p>
                {% if news.img %}
                    <img class="news-img" src="{{ news.img }}" alt="{{ news.title }}">
                {% endif %}
                <p>类型: {{ news.get_type_display }}</p>
            </li>
        {% endfor %}
    </ul>

    <h1>最新活动</h1>
    <ul>
        {% for activity in latest_activities %}
            <li>
                <h2>{{ activity.title }}</h2>
                <p>{{ activity.create_time }}</p>
                <p>{{ activity.content }}</p>
                {% if activity.img %}
                    <img class="news-img" src="{{ activity.img}}" alt="{{ activity.title }}">
                {% endif %}
                <p>类型: {{ activity.get_type_display }}</p>
            </li>
        {% endfor %}
    </ul>

    <h1>最新公告</h1>
    <ul>
        {% for announcement in latest_announcements %}
            <li>
                <h2>{{ announcement.title }}</h2>
                <p>{{ announcement.create_time }}</p>
                <p>{{ announcement.content }}</p>
                {% if announcement.img %}
                    <img class="news-img" src="{{ announcement.img }}" alt="{{ announcement.title }}">
                {% endif %}
                <p>类型: {{ announcement.get_type_display }}</p>
            </li>
        {% endfor %}
    </ul>
</body>
</html>